home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d918.lha / MultiPlot / Plt / PLT_docs / hpgl_commands next >
Text File  |  1993-10-04  |  15KB  |  374 lines

  1.                            HP-GL COMMANDS
  2.                            --------------
  3.  
  4.  
  5. The following is a list of the HP-GL commands that are currently
  6. supported by PLT:.  For the most part they were implemented from the 
  7. descriptions provided in the "HP ColorPro Graphics Plotter Programming 
  8. Manual".  It appears as though every HP plotter has a slightly different
  9. set of HP-GL commands.  Some have extra commands, some of the commands that
  10. have parameters for one plotter may not have parameters for a different
  11. plotter (PA and PR come to mind).  We followed the manual pretty accurately,
  12. but we borrowed a couple of commands from a different plotter to control
  13. when a page is ejected from the plotter.  For example, the AF command
  14. causes a page to be printed, this allows people to send several pages of
  15. plots to PLT: without having to break the input up into several files 
  16. or several executions.  Some commands in the manual were not emulated
  17. since they did not make sense for a raster emulation of a plotter.
  18.  
  19.  
  20.  
  21. o   The <term> symbol signifies a command terminator, it may be a space, a 
  22.     semi-colon or the first character of the next command.
  23.  
  24. o   Command names are NOT case sensitive.
  25.  
  26. o   Parameters that are incased in parenthesis in the command description 
  27.     are optional parameters.  Do not use the paranthesis when specifying the
  28.     command.
  29.  
  30.  
  31. ----------------------------------------------------------------------------
  32. ----------------------------------------------------------------------------
  33.  
  34. Arc Absolute
  35. AA center_x, center_y, arc_angle (,chord_angle) <term>
  36.         Draws an arc starting at the current pen position for the specified
  37.         arc angle.  The center point of the circle of which the arc is a 
  38.         portion of is specified by center_x and center_y.  A positive arc 
  39.         angle draws an arc counter-clockwise from the start point, and a
  40.         negative arc angle draws an arc clockwise.  The arc is drawn with
  41.         line segments, and the chord angle specifies the number of a
  42.         degrees seperating the endpoints of a line segment.  (For example,
  43.         chord angle of 20 would cause a 180 degree arc to be composed of
  44.         9 line segments.  The default chord angle is 5 degrees, and a an
  45.         chord angle >180 is computed as 360-chord_angle.  The pen is left
  46.         at the end of the arc, and is lowered.
  47.  
  48. Advance Full Page
  49. AF <term>
  50.         Causes a page to be plotted/printed
  51.  
  52.  
  53. Arc Relative
  54. AA center_x, center_y, arc_angle (,chord_angle) <term>
  55.         Draws an arc starting at the current pen position for the specified
  56.         arc angle.  The center point of the circle of which the arc is a 
  57.         portion of is specified relative to the pen position by the offsets
  58.         center_x and center_y.  A positive arc angle draws an arc counter-
  59.         clockwise from the start point, and a negative arc angle draws an arc
  60.         clockwise.  The arc is drawn with line segments, and the chord angle 
  61.         specifies the number of a degrees seperating the endpoints of a line 
  62.         segment.  (For example, chord angle of 20 would cause a 180 degree 
  63.         arc to be composed of 9 line segments.  The default chord angle is 5 
  64.         degrees, and a chord angle >180 is computed as 360 - chord_angle.
  65.         The pen is left at the end of the arc, and is lowered.
  66.  
  67. Designate Alternate Character Set
  68. CA font_number <term>           
  69. CA <term>
  70.         Selects font_number to be the alternate character set.
  71.         The alternate character set is used as the current font
  72.         through the use of the SA command.
  73.         0 <= font_number <= 50
  74.  
  75. Circle
  76. CI radius (,chord_angle) <term>
  77.         Draws a circle of the specified radius with the center point at
  78.         the pen position.  The circle is drawn with line segments, and the
  79.         chord angle specifies the number of degrees seperating the endpoints
  80.         of the line segments.  For example, a chord angle of 10 degrees 
  81.         would cause a circle to be drawn with 36 lines segments.  The default
  82.         chord angle is 5 degrees, and a chord angle >180 is computed as
  83.         360 - chord_angle.  The pen position and pen state (raised,lowered)
  84.         is restored after the command is executed.
  85.  
  86. Character Plot
  87. CP spaces, lines <term>
  88. CP <term>
  89.         Moves the pen the specified number of character plot cells.
  90.         All movements are relative to the current label direction.
  91.         
  92.                         spaces          lines
  93.         ----------------------------------------------
  94.         positive        move right      move left
  95.         negative        move up         move down
  96.  
  97.         A CP command with no parameters performs a carriage return and a
  98.         line feed.
  99.  
  100.  
  101. Designate Standard Character Set
  102. CS font_number <term>
  103.         Selects font_number to be the standard character set.
  104.         The standard character set is used by default or 
  105.         through the use of the SS command.
  106.         0 <= font_number <= 50
  107.  
  108.  
  109. Default
  110. DF <term>
  111.         Set certain plotter functions to predefined defaults.
  112.         This command maintains the locations of P1 and P2.
  113.  
  114.                              Default Conditions
  115.  
  116.         Function        Equivalent Instructions         Conditions
  117.         -----------------------------------------------------------
  118.         Plotting mode           PA;                     Absolute
  119.         Line type               LT;                     Solid line
  120.         Line pattern            LT;                     4% of (P1, P2)
  121.                 length
  122.         Relative Character      DR1,0;                  Horizontal
  123.                 Direction
  124.         Relative Character      SR;                     width=.75% of (P2x-P1x)
  125.                 Size                                    height=1.5% of(P2y-P1y)
  126.         Standard Character      CS0;                    set 0
  127.                 Set
  128.         Alternate Character     CA0;                    set 0
  129.                 Set
  130.         Character Set           SS;                     standard
  131.                 Selected
  132.         Character Slant         SL0;                    0 degrees
  133.         Label Terminator        DTetx;                  etx(ascii code 3)
  134.         Symbol Mode             SM;                     Off
  135.         Tick Length             TL;                     tp=tn=.5% of |P2x-P1x|
  136.                                                                 for y tick
  137.                                                         tp=tn=.5% of |P2y-P1y|
  138.                                                                 for x tick
  139.         Scale                   SC;                     User-unit scaling off
  140.  
  141.  
  142. Absolute Direction
  143. DI run, rise <term>
  144. DI <term>
  145.         Specifies the direction in which labels are drawn, independent of
  146.         P2 and P1 settings. If no parameters are given, then the direction
  147.         is set for horizontal.
  148.  
  149.         run = cos(angle)
  150.         rise = sin(angle)
  151.  
  152.         angle = arctan(rise/run)
  153.  
  154.  
  155. Relative Direction
  156. DR run, rise <term>
  157. DR <term>
  158.         Specifies the direction that labels are drawn relative to the
  159.         scaling points P1 and P2.  When the scaling points move, the
  160.         label direction is adjusted to maintain the same relationship.
  161.         A DR command with no parameters sets the direction for horizontal.
  162.  
  163.         run  -- the percentage of P2x - P1x
  164.         rise -- the percentage of P2y - P1y
  165.  
  166.  
  167. Define Label Terminator
  168. DT label_terminator <term>
  169.         The character immediately following the DT command is used as
  170.         the new label terminator.  The label terminator is the
  171.         character that signifies when the data for the label is complete
  172.         so the plotter can start interpreting the input stream as commands
  173.         again.  Be careful not to place a space between the DT and the 
  174.         character that you want for the terminator.  Otherwise the space
  175.         will become the new terminator.
  176.  
  177.  
  178. Initialize
  179. IN <term>
  180.         Returns the plotter to its power on state.  Performs a DF AND:
  181.  
  182.         o   raises the pen
  183.         o   sets P1 and P2 to the default states
  184.         o   cancels 90 degree rotation
  185.  
  186.  
  187.  
  188. Input P1 and P2
  189. IP P1x, P1y (, P2x, P2y) <term>
  190. IP <term>
  191.         P1 and P2 are used as scaling points for fonts as well as for
  192.         establishing the location for a user-defined coordinate system.
  193.  
  194.         Can either specify the positions of both scaling points, just the
  195.         first, or reset them to their defaults by specifying no parameters.
  196.         If only P1 in specified, then P2 will move to keep the distance
  197.         between P1 and P2 constant (P2 tracks P1).
  198.  
  199.         Defaults:
  200.         ---------
  201.                 P1x =   250
  202.                 P1y =   279
  203.                 P2x = 10250
  204.                 P2y =  7479
  205.  
  206.  
  207. Label
  208. LB c...c <label_terminator>
  209.         Puts text on the page starting at the current pen position.  
  210.         Every character between LB and <label_terminator> is plotted.
  211.         <label_terminator> is usually ascii code 3, but can be set by
  212.         the DT command.  The LB command uses the current selected font
  213.         and current label direction.
  214.  
  215.  
  216. Line Type
  217. LT pattern_number (, pattern_length) <term>
  218. LT <term>
  219.         Selects the type of line that is plotted when the pen is down
  220.         and moving. An LT command without a parameter specifies a solid line.
  221.         Pattern 0 puts a dot at the endpoints of a line.
  222.         Patterns 1-6 are dotted, dashed, dashed-dotted combinations.
  223.         
  224.         The length of the pattern can be specified through the use of
  225.         pattern_length.  It is expressed as the percentage of the
  226.         diagonal distance between P1 and P2.  
  227.  
  228.         Any portion of a pattern not used for the current line is
  229.         carried over to the next line (provide a PU is not issued).
  230.  
  231.  
  232. Plot Absolute
  233. PA X, Y (, ...) <term>
  234. PA <term>
  235.         Place the plotter in absolute mode.  Causes all coordinates to then
  236.         be interpretted as actual coordinates and not offsets from the 
  237.         current pen position.  Coordinates can be specified with the 
  238.         command as well.  It this case the pen is moved to the 
  239.         appropriate locations.  If the pen is down a line will be drawn
  240.         in the current pattern.  If the pen is up then it is merely moved
  241.         through the coordinates without drawing lines.
  242.  
  243.  
  244. Pen Down
  245. PD X, Y (, ...) <term>
  246. PD <term>
  247.         Places the pen down onto the paper.  If coordinates are specified 
  248.         then the pen is moved to those locations (absolutely or relatively
  249.         depending on the current status).  A line is drawn using the
  250.         current pattern.
  251.  
  252.  
  253. Page Forward
  254. PG <term>
  255.         Performs the same function as AF.  Added to PLT: to allow greater
  256.         compatibility with slightly different plotter command sets.
  257.  
  258.  
  259. Pen Up
  260. PU X, Y (, ...) <term>
  261. PU <term>
  262.         Raises the pen.  If coordinates are given then the pen is moved
  263.         (relatively or absolutely depending on the current status) to the
  264.         specified locations.
  265.  
  266.  
  267.  
  268. Rotate
  269. RO n <term>
  270. RO <term>
  271.         Rotate the page to 0 or 90 degrees.  Used for making plots in
  272.         portrait mode. n can either be 0 or 90.  If no parameters are
  273.         given then n is taken to be 0. P1 an P2 rotate with the coordinate
  274.         system, but they maintain the same (x,y) positions.  This means that
  275.         P2 can be located outside the drawing area.  Following a RO 90; by
  276.         an IP; will set P1 and P2 to the soft-clip limits.
  277.  
  278.  
  279.  
  280. Select Alternate Character Set
  281. SA <term>
  282.         Future labels will be drawn using the alternate character set as
  283.         the font.  This font can be set using the CA command.
  284.  
  285.  
  286. Scale
  287. SC Xmin, Xmax, Ymin, Ymax <term>
  288. SC <term>
  289.         Establishes a user-coordinate system by mapping values onto the
  290.         scaling points P1, P2.  All subsequent moves will be interpretted
  291.         as coordinates in this coordinated system.  If no parameters are 
  292.         given the scaling is turned off.
  293.  
  294.  
  295.  
  296. Absolute Character Size
  297. SI width, height <term>
  298. Si <term>
  299.         Specifies the size of character in centimeters.  This establishes
  300.         character sizes regardless of the locations of the scaling points.
  301.         With no parameters, the default sizes are used.
  302.  
  303.  
  304. Character Slant
  305. SL tan_angle <term>
  306. SL <term>
  307.         Specifies the slant given to characters as they are drawn.
  308.         Makes tht font look more like an italic font. tan_angle specifies
  309.         how far off the vertical the font is slanted. Positive values
  310.         slant the font clockwise off the vertical, negative values
  311.         slant the font counter-clockwise.  With no parameter, the font
  312.         is not slanted at all.
  313.  
  314.  
  315. Symbol Mode
  316. SM character <term>
  317. SM <term>
  318.         Places the plotter in symbol mode. On subsequent moves the
  319.         character specified will be plotted at the various endpoints.
  320.         Used for scatter plots and emphasizing line endpoints.  With
  321.         no parameters, symbol mode is turned off.
  322.  
  323.  
  324. Select Pen
  325. SP pen_number <term>
  326. SP <term>
  327.         Use pen_number as the current pen.  With no parameters, the pen
  328.         is returned to the carousel.  Pens can be different colors
  329.         or different thicknesses.
  330.         0 <= pen_number <= 8
  331.  
  332.  
  333. Relative Character Size
  334. SR width, height <term>
  335. SR <term>
  336.         Specifies the relative character size as a percentage of the 
  337.         distance between P1 and P2.  When the positions of P1 and P2
  338.         change, the size of the characters will also change to maintain the
  339.         scale.  Without parameters, the default sizes are used.
  340.  
  341.  
  342. Select Standard Character Set
  343. SS <term>
  344.         Use the standard character set as the current font.  The font
  345.         used as the standard character set can be set using the CS command.
  346.  
  347.  
  348. Tick Length
  349. TL tp (, tn) <term>
  350. TL <term>
  351.         Specifies the length of the tick marks for both the X and Y-axes.
  352.         tp is the length of the positive portion of the tick (up or right), 
  353.         tn is the length of the negative portion of the tick (down or left).
  354.         tp an tn are specified as a percentage of |P2x - P1x| and
  355.         |P2y - P1y|.  Y-ticks use |P2x - P1x|, X-ticks use |P2y - P1y|.
  356.         To supress the negative portion of the tick, don not specify
  357.         a tn.  To supress the positive portion of the tick, specify 0 for the
  358.         tp.
  359.  
  360.  
  361. X-axis Tick
  362. XT <term>
  363.         Place a verticl tick mark at the current pen position.  The length
  364.         of the tick can be specified through the use of the TL command.
  365.  
  366.  
  367.  
  368. Y-axis Tick
  369. YT <term>
  370.         Place a horizontal tick mark at the current pen position.  The
  371.         length of the tick can be specified through the use of the TL
  372.         command.  
  373.  
  374.